package com.qiaofang.applet.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Author : seven
 * Date   : 2020-9-27
 * Desc   :
 */
@Configuration
public class MicrometerAutoConfiguration {
    @Value("${spring.application.name:unknown}")
    private String appName;

    @Bean
    MeterRegistryCustomizer metricsCommonTags() {
        return meterRegistry -> {
            meterRegistry.config().commonTags("application", appName);
        };
    }
}
